#include <QtGui/QApplication>
#include <QtXml/QDomDocument>
#include <QtCore/QFile>
#include "mainWindow.h"

bool loadXmlFile(const QString & xmlFile, QDomDocument & doc)
{
	QFile file(xmlFile);
	if (!file.open(QIODevice::ReadOnly)) {
		qWarning("File Open error!\n"
			"\tPlease make sure the file '%s' exists and can be read.", qPrintable(xmlFile));
		return false;
	}
	if (!doc.setContent(&file)) {
		file.close();
		qWarning("XML Document load error!\n"
			"\t Please make sure that the file '%s' is a valid XML.", qPrintable(xmlFile));
		return false;
	}
	file.close();
	return true;
}

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	MainWindow w;
	w.show();
	a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
	return a.exec();
}
